//
//  AsyncImageView.swift
//  SwiftUIExample
//
//  Created by qingzhou on 2021/6/18.
//

import SwiftUI

@available(iOS 15.0, *)
struct AsyncImageView: View {
    var body: some View {
        ///加载网络图片
        AsyncImage(url: URL(string: "https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png")) { image in
            image.resizable()
        } placeholder: {
            Color.red
        }
        .frame(width: 60, height: 60)
        .clipShape(RoundedRectangle(cornerRadius: 25))
    }
}

@available(iOS 15.0, *)
struct AsyncImageView_Previews: PreviewProvider {
    static var previews: some View {
        AsyncImageView()
    }
}
